home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / GRAPHICS / UVE138.ZIP / EXAMPLES.ZIP / WINDOW.PAS < prev   
Encoding:
Pascal/Delphi Source File  |  1996-08-30  |  1.1 KB  |  64 lines

  1. {$A+,B-,D+,E+,F-,G+,I+,L+,N-,O-,P-,Q-,R-,S+,T-,V+,X+}
  2. {$M 16384,0,655360}
  3.  
  4. {
  5. GLENZ.PAS
  6. Demonstrates     - animation window
  7.         - clipping depth
  8. }
  9.  
  10. uses    crt,uve32;
  11.  
  12. const    maxspheres=100;
  13.  
  14.  
  15.  
  16. procedure init;
  17. var    pal:palette;
  18.     i:integer;
  19. begin
  20.     ia_inituve;
  21.     ia_loadspr('sphere.uvl',1);
  22.     ia_loadpalette('sphere.pal',pal);
  23.     ia_chainsprite(1,spritesloaded,1);
  24.     ia_loadfont(8);
  25.     ia_setfontattr(8,plain,proportional,horizontal,255,true,0);
  26.     ia_powerup;
  27.     ia_setpalette(pal);
  28.     ia_setcycletime(40);
  29.     ia_setclipdepth(20);
  30.     for i:=1 to maxspheres do with spr[i] do begin
  31.         x:=random(310);
  32.         y:=random(190);
  33.         n:=1+random(30);
  34.     end;
  35. end;
  36.  
  37. procedure deinit;
  38. begin
  39.     ia_shutdown;
  40.     halt;
  41. end;
  42.  
  43. var    ch:char;
  44.     size:integer;
  45. begin
  46.     init;
  47.     size:=0;
  48.     repeat
  49.         ia_doframepart1;
  50.         ia_doframepart2;
  51.         ia_box(hidden,size,size,319-size,199-size,83,false);
  52.         ia_printstr(hidden,-32768,30,'Use + and - to resize window',89);
  53.         ia_doframepart3;
  54.         if keypressed then begin
  55.             ch:=readkey;
  56.             case ch of
  57.             '+': size:=max(0,size-1);
  58.             '-': size:=min(95,size+1);
  59.             end;
  60.             ia_setwindow(size,size,319-size,199-size);
  61.         end;
  62.     until ch=#27;
  63.     deinit;
  64. end.